<?php

namespace App\Admin\Actions\App;

use App\Admin\Forms\SetupOssForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
use Throwable;

class SetupApplicationOss extends RowAction
{
    protected string $title = '配置云存储(CDN)';

    /**
     * @throws Throwable
     */
    public function render(): string
    {
        return Modal::make()
            ->lg()
            ->centered()
            ->title($this->title)
            ->body(SetupOssForm::make()->payload(['application_id' => $this->getKey()]))
            ->button($this->title)
            ->render();
    }
}
